<section class="to-pay pd10">
  <h3>订单已经提交成功，请尽快支付</h3>
  <div>
    <p>订单编号：{$order.order_id}</p>
    <p>收货人称：{$order.consignee}</p>
    <p>手机号码：{$order.tel}</p>
    <p>收货地址：{$order.address}</p>
    <p>金额合计：<b>￥{$order['goods_amount']+$order['shipping_fee']}</b></p>
  </div>
</section>

<section class="to-pay-type mg10">
  <h4>请选择支付方式</h4>
  <form method="post" action="__CONTROLLER__/toPay">
    <ul id="pay-type" class="lists">
      <li class="lists-item">
        <a>请选择支付方式</a>
      </li>
    </ul>
    <input id="pay-type-hidden" type="hidden" name="apitype" value="">
    <input type="hidden" name="id" value="{$order.id}">
    <input type="hidden" name="sid" value="{$sid}">
    <button class="btn btn-orange w100 mt10">立即付款</button>
  </form>
</section>

<script src="__COMMON__/js/modal.js"></script>

<script type="text/javascript">
  (function(){
    
    var payJSON = {$productPayApiJSON};
    var data = [[{text: "请选择支付方式", label: true}], [{text: "取消", close:true}]];
    
    for ( var i in payJSON ) {
      var name = payJSON[i];
      var vname = i;
      data[0].push ({ text: name, close:true, click: (function(name, vname){ 
        return function() { 
          select( name, vname );
        };
      })(name, vname)});
    }
    
    var payType = document.getElementById ( "pay-type" ),
        payTypeHidden = document.getElementById ( "pay-type-hidden" );
    payType.addEventListener ( "touchend", function(){
      modal.actions( data );
    }, false );
    
    function select( text, value ){
      payTypeHidden.setAttribute ( "value", value );
      payType.children[0].children[0].innerHTML = text;
    }
    
  })();

</script>